package com.kly.sc.api.integration.userplatform;

import com.kly.sc.api.infras.exception.ApplicationException;
import com.kly.sc.api.integration.userplatform.util.ApiUtils;
import okhttp3.Credentials;
import java.util.Map;

/**
 * @author linqu
 */
public class UserApiClient {

    public ChatterAPI ChatterAPI;
    public GreetingAPI GreetingAPI;

    public UserApiClient(String key, String secret) throws ApplicationException {
        this(key, secret, false);
    }

    public UserApiClient(String key, String secret, Boolean enableLogging) throws ApplicationException {
        ApiUtils.createHttpClientInstance(enableLogging);
        String auth = Credentials.basic(key, secret);
        this.ChatterAPI = new ChatterAPI(auth);
        this.GreetingAPI = new GreetingAPI(auth);


    }

    public UserApiClient addHeaders(Map<String, String> headers) {
        ApiUtils.addHeaders(headers);
        return this;
    }

}
